﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Search.aspx.cs" Inherits="FlowersStore.Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="page">
        <div class="content" style="width: 350px">
            <div class="MainMenueSearchTool">
                <asp:TextBox ID="tbKeyWords" runat="server" Width="300" />
            </div>
            <div class="MainMenuSearchGlass">
                <asp:ImageButton ID="btnSearch" ImageUrl="Styles/Images/Search.png" runat="server"
                    OnClick="SearchAgain" />
            </div>
        </div>
    </div>
    <h1>
        Результаты</h1>
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SearchDataSource">
        <EmptyDataTemplate>
            <span>Не найдено результатов, удовлетворяющих запросу</span>
        </EmptyDataTemplate>
        <ItemTemplate>
            <tt class="ProductName" style="float: left; padding-right: 750px;">
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("Product_name") %>' />
            </tt>
            <br />
            <div class="ProductPreView" runat="server">
                <div style="margin-left: -4px; margin-top: 5px; text-align: center;">
                    <a href="ProductDetails.aspx?product=<%# Eval("Product_id") %>">
                        <img alt="цветок" src='<%#Eval("product_thimbnailurl")%>' /></a>
                </div>
            </div>
            <%--<div class="clear">
            </div>--%>
            <br />
            <div style="width: 470px; text-align: left; vertical-align: top; padding-left: 20px;">
                <p id="ProductDesc" class="ProductDescription" style="text-align: left" runat="server">
                    <%# Eval("Product_description") %></p>
                <%--  <div style="width: 150px;">--%>
                <tt class="ProductPrice">
                    <asp:Label ID="Product_priceLabel" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Product_price","{0:n0}") %>' />
                    руб. </tt><span class="ProductBuy">
                        <asp:ImageButton AlternateText="В корзину" ImageUrl="Styles/Images/InCart.png" ID="btnInCart"
                            OnClick="btnInCart_Click" runat="server" CommandArgument='<%# Eval("Product_id") %>' />
                    </span>
                <%-- </div>--%>
            </div>
            <div class="clear">
            </div>
        </ItemTemplate>
        <LayoutTemplate>
            <div id="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div class="clear">
            </div>
            <div style="">
                <asp:DataPager ID="DataPager1" runat="server">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                            ShowPreviousPageButton="False" />
                        <asp:NumericPagerField />
                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                            ShowPreviousPageButton="False" />
                    </Fields>
                </asp:DataPager>
            </div>
        </LayoutTemplate>
    </asp:ListView>
    <br />
    <asp:SqlDataSource ID="SearchDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:FlowerStoreConnectionString %>"
        SelectCommand="GetSearchResults" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <%-- <asp:Parameter Name="keyword1" Type="String" />
            <asp:Parameter Name="keyword2" Type="String" />
            <asp:Parameter Name="keyword3" Type="String" />
            <asp:Parameter Name="keyword4" Type="String" />
            <asp:Parameter Name="keyword5" Type="String" />--%>
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
